<template>
  <t-image-viewer v-if="!store.isMobileType" v-model:visible="ImgVisible" :images="[urls + props.info.value]">
  </t-image-viewer>
  <van-image-preview :show-index="false" v-else v-model:show="ImgVisible" :images="[urls + props.info.value]">
  </van-image-preview>
  <div class="outline-parent jy-style-height border-hover-style">
    <t-popup
      class="placement bottom center"
      attach="#attach"
      content="查看本单元全景展厅"
      placement="bottom"
      showArrow
      destroyOnClose
    > 
      <img 
        v-if="props.info.digitalShowroom"
        class="icon-3d blinking-animation-style" 
        id="outlineIcon"
        @click="open(props.info.digitalShowroom)"
        :src="publicUrls + 'free/style1/3dIcon.png'"
      />
    </t-popup>
    <img class="outline-parent-bg" :src="publicUrls + 'free/style1/Level1outlineStyle1Bg.webp'" alt="" />
    <div class="outline jy-style-height">
      <div
        class="outline-content"
        :style="!props.info.subTitle && !props.info.remarks && props.info.value && { justifyContent: 'center' }"
      >
        <div
          class="content-tiitle"
          :style="{
            'background-image': `url(${publicUrls + 'free/style1/Level1outlineStyle1titleBg.webp'})`,
          }"
        >
          <span>{{ props.info.text }} </span>
        </div>
        <p class="outline-subTitle" v-if="props.info.subTitle">——{{ props.info.subTitle }}</p>
        <div class="cover" v-if="props.info.value" :class="{ 'cover-no': !props.info.remarks }">
          <div
            class="cover-left"
            :style="{
              'background-image': `url(${publicUrls + 'free/style1/Level1outlineStyle1Cover1Bg.webp'})`,
            }"
          ></div>
          <div class="cover-content">
            <img
              class="outline-cover"
              @click="ImgVisible = true"
              :src="urls + props.info.value + '?imageView2/3/format/webp'"
              alt=""
            />
          </div>
          <div
            class="cover-right"
            :style="{
              'background-image': `url(${publicUrls + 'free/style1/Level1outlineStyle1Cover2Bg.webp'})`,
            }"
          ></div>
        </div>
        <TextMax
          v-if="props.domShow"
          :data="props.info.remarks"
          :title="props.info.text"
          :row="props.info.value ? 5 : 14"
        ></TextMax>
      </div>
    </div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'style1',
});
</script>

<script setup lang="ts">
import ExpandableText from './../../../textMode/ExpandableText.vue';
import { publicUrls } from '@/utils/minxin';
import { getTextHtml } from '@/utils/minxin';
import { urls } from '@/utils/request/upload';
import { defineComponent, nextTick, ref } from 'vue';
import TextMax from '@/freeComponents/textMode/TextMax.vue';
import { useProjectStore } from '@/store';
const store = useProjectStore();
const ImgVisible = ref(false);

const props = defineProps({
  info: {
    type: Object,
  },
  domShow: {
    type: Boolean,
  },
});
// 跳转全景链接
const open = (url: any) => {
  if (url) {
    window.open(url, '_blank');
  }
};
</script>

<style scoped lang="less">
.outline-parent {
  position: relative;
  margin-top: 0;
  margin-right: 280px;
}
.outline-parent-bg {
  width: 764px;
  height: calc(100%);
}
.icon-3d {
  width: 52px;
  height: 64px;
  object-fit: contain;
  position: absolute;
  top: 26px;
  right: 120px;
  z-index: 21;
}
.outline {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.outline-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 526px;
  height: calc(100% - 200px);
}
.content-tiitle {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 526px;
  height: 64px;
  background-size: 100% 100%;
  background-repeat: no-repeat;
  margin-bottom: 16px;
  box-shadow: 0px 2px 4px rgba(50, 43, 37, 0.25);
  padding: 8px;
  span {
    font-family: SourceHanSerifCN-Bold;
    font-size: 31.5px;
    line-height: 48px;
    text-align: center;
    color: rgba(50, 43, 37, 1);
  }
}
.text-box {
  // position: relative;
  width: 100%;
  // height: 66px;
}
.outline-subTitle {
  width: 510px;
  text-align: center;
  font-family: SourceMedium;
  font-size: 18px;
  line-height: 28px;
  text-align: center;
  color: rgba(50, 43, 37, 1);
}
.cover {
  display: flex;
  align-items: center;
  width: 510px;
  height: 280px;
  margin: 30px 0;
}
.cover-no {
  height: 470px;
}
.cover-left {
  width: 82px;
  height: 277.12px;
  margin-right: -4px;
}
.cover-right {
  width: 82px;
  height: 277.12px;
  margin-left: -4px;
}
.cover-left,
.cover-right {
  background-repeat: no-repeat;
  background-size: 100% 100%;
}
.cover-content {
  width: 354px;
  height: 100%;
  border-radius: 6px;
  border: 4px solid rgba(108, 92, 79, 1);
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: rgba(244, 205, 134, 0.2);
  }
}
.outline-remarks {
  width: 510px;
  :deep(.openText) {
    justify-content: center;
    font-family: PingFang SC;
    font-size: 16px;
    font-weight: 400;
    line-height: 32px;
    color: rgba(85, 59, 42, 1);
    span {
      color: rgba(85, 59, 42, 1);
    }
  }
  :deep(.text p) {
    color: rgba(50, 43, 37, 1);
  }
  :deep(.omission) {
    color: rgba(50, 43, 37, 1);
  }
}
::v-deep .t-popup__content {
  background: #886c56;
  padding: 2px 12px;
  font-family: 'Microsoft YaHei';
  font-size: 13px;
  line-height: 20px;
  color: #fef3df;
  box-shadow: 0px 0px 4px 0px rgba(0, 0, 0, 0.25);
  margin-top: 6px !important;
}
::v-deep .t-popup__arrow::before {
  background: #886c56;
  border: none;
  box-shadow: none !important;
}
</style>